package com.ynding.spring.idea.ddd.common.service.integration.lottery;

import com.ynding.spring.idea.ddd.common.aax.bo.ResponseBean;
import com.ynding.spring.idea.ddd.common.service.integration.lottery.api.LbsService;
import com.ynding.spring.idea.ddd.common.service.integration.lottery.dto.MtCityInfoDTO;
import com.ynding.spring.idea.ddd.common.service.integration.lottery.requset.LbsReq;
import com.ynding.spring.idea.ddd.common.aax.util.LotteryContext;
import org.springframework.stereotype.Component;

/**
 * 城市外部服务
 * @author ynding
 * @version 2022/9/3
 **/
@Component
public class UserCityInfoIntegration {

    /**
     * 外部用户城市信息RPC服务
     */
    private LbsService lbsService;

    public MtCityInfoDTO getMtCityInfo(LotteryContext context) {
        LbsReq lbsReq = new LbsReq();
        lbsReq.setLat(context.getLat());
        lbsReq.setLng(context.getLng());
        ResponseBean resp = lbsService.getLbsCityInfo(lbsReq);
        return buildMtCityInfo(resp);
    }

    private MtCityInfoDTO buildMtCityInfo(ResponseBean resp) {
        // TODO
        return null;
    }

}
